﻿<T:ViewBase x:Class="WPFExcelReport.VWVKP"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
            xmlns:Localization="clr-namespace:Localization;assembly=Localization"
            xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"
            xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
            Background="White"
            Name="TV"
 >
    <T:ViewBase.Resources>
        <ucd:BoolToVisibilityConverter x:Key="bv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:DXMCONVERTER  x:Key="dxm"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=SetMaster.VKPOS}"/>
        <CollectionViewSource   x:Key="vwBASTGA" Source="{Binding Path=SetDetail.BASTGA}"/>
        <CollectionViewSource   x:Key="vwWASTGA" Source="{Binding Path=SetDetail.WASTGA}"/>
    </T:ViewBase.Resources>
    <Grid Margin="10,10,0,0" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Column="0" Grid.ColumnSpan="1">
            <WrapPanel>
                <TextBlock Width="Auto">任务书:</TextBlock>
                <ex:TXT72 IsAutoClear="True"   Name="txtVKPAUFKRS" Text="{Binding KRS}" PRE="  " MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper"/>
                <ex:TXT72 IsAutoClear="True"   Name="txtVKPAUFLFD" Text="{Binding LFD}" PRE="000000"  MaxLength="6" Width="80" Margin="0,0,0,0"   HorizontalAlignment="Left" KeyDown="txtVKPAUFLFD_KeyUp"/>
                <TextBox  Name="txtVKPAUFPOS" Visibility="Collapsed" Width="60" Margin="0,0,0,0" Text="{Binding Path=VKPAUFPOS, Source={StaticResource ResourceKey=vwVKPOS}}" HorizontalAlignment="Left" Background="Yellow" KeyboardNavigation.TabIndex="0" />
                <Button  Height="20"  Width="20" Margin="10,0,0,0" Name="btnGetVKKOPF" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBlock Text="查询"></TextBlock>
            </WrapPanel>
            <WrapPanel>
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>                  
                    <TextBlock Grid.Column="0" Text="重置参数"></TextBlock>
                    <Button  Grid.Column="1" Height="20"  Width="20" Margin="0,0,0,0"   IsEnabled="True" VerticalAlignment="Top" Click="btnResetP_Click">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Reload.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="100"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="交货范围"></TextBlock>
                <TextBox Grid.Column="1" Text="{Binding Path=OVERSHORT, Converter={StaticResource ResourceKey=gb2312}, Source={StaticResource ResourceKey=vwVKPOS}}" Width="150"></TextBox>
            </Grid>
            </WrapPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="规格" Width="Auto"></TextBlock>
                <TextBox Grid.Column="1"   Text="{Binding Path=CONSTRUCTION, Source={StaticResource ResourceKey=vwVKPOS}}" Width="Auto"></TextBox>
            </Grid>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" Text="备注"></TextBlock>
                <TextBox Grid.Row="1"  Name="txtVKRemark" Height="80" ScrollViewer.CanContentScroll="True" VerticalScrollBarVisibility="Auto"  HorizontalScrollBarVisibility="Visible"
                   Text="{Binding REMARK}"></TextBox>
            </Grid>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/> 
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" Text="任务书备注"></TextBlock>
                <Button  Height="20"  Width="20" Margin="10,0,0,0"   Click="btnUpdateRemark_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Refresh.png" />
                    </Button.Background>
                </Button>
                <TextBox MaxLength="160" Grid.Row="2"  Height="80" ScrollViewer.CanContentScroll="True" VerticalScrollBarVisibility="Auto"  HorizontalScrollBarVisibility="Visible"
                        KeyUp="REMARK_KeyUp" Background="White"  
                   Text="{Binding REMARK,Converter={StaticResource gb2312}, ElementName=TV}"/>
            </Grid>
        </StackPanel>
        <DataGrid  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1"
                        FontSize="12"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}"  
                              HeadersVisibility="Column" 
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" 
                              >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header="POS"   Width="Auto"  MinWidth="30"/>
                <DataGridTextColumn Binding="{Binding Path=VKPPOSTYP}" Header="类型"   Width="Auto"  MinWidth="40"/>
                <!--DataGridTextColumn Binding="{Binding Path=VKPZUSATZ,Converter={StaticResource ResourceKey=gb2312}}" Header="标准"  Width="Auto" MinWidth="20"/-->
                <DataGridTextColumn Binding="{Binding Path=VKPART, Converter={StaticResource ResourceKey=Trim}}" Header="品种"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="颜色"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="单位"  Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="交期"  Width="Auto" MinWidth="40"/>
            </DataGrid.Columns>
        </DataGrid>
        <Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Grid.ColumnSpan="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <WrapPanel  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="预计划" FontWeight="Bold" Margin="0,0,0,0"></TextBlock>
                    <Button Grid.Column="1" Height="30"  Width="30" Margin="0,0,0,0"  Visibility="{Binding CanReplan, Converter={StaticResource ResourceKey=bv}}"  Name="btnPrePlan" Click="btnPrePlan_Click">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Refresh.png" />
                        </Button.Background>
                    </Button>              
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=订单数量m}}" Width="Auto"></TextBlock>
                    <TextBox Grid.Column="1"   Height="20" Text="{Binding Path=SQTYEND,ElementName=TV}" 
                             Name="txtSQty"
                              KeyDown="TextBox_KeyDown"
                             MinWidth="80"></TextBox>
                </Grid>
                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="交货范围"></TextBlock>
                    <TextBox Name="txtSR01DES" Grid.Column="1" Text="1" Width="100"></TextBox>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="投料范围"></TextBlock>
                    <TextBlock Grid.Column="1" Text="0" Name="txtNSR01" Foreground="Red" FontStyle="Italic"   Height="20" VerticalAlignment="Top" Width="Auto"/>
                    <TextBox Grid.Column="2" Text="0" Name="txtSR01" Foreground="Red" KeyDown="TextBox_KeyDown" Height="20" VerticalAlignment="Top" Width="30"></TextBox>
                </Grid>
                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="40"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="附加"></TextBlock>
                    <TextBox Grid.Column="1" Text="0" Name="txtSF01"  KeyDown="TextBox_KeyDown" Height="20" VerticalAlignment="Top"></TextBox>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="80"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="翻单"></TextBlock>
                    <TextBox Grid.Column="1"  Height="20" Text="{Binding Path=REPEATORDER, Source={StaticResource ResourceKey=vwVKPOS}}" KeyDown="TextBox_KeyDown" Width="80"></TextBox>
                </Grid>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="80"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="可用成品数量"></TextBlock>
                    <TextBox Grid.Column="1"  Height="20" Text="{Binding Path=PREALLOCATED, Source={StaticResource ResourceKey=vwVKPOS}}" Width="80" KeyDown="TextBox_KeyDown"></TextBox>
                </Grid>
            </WrapPanel>
            <StackPanel  Grid.Row="1" Grid.Column="0">
                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="40"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=后整计划}}" ></TextBlock>
                    <CheckBox Grid.Column="1" Name="ChkAB05" VerticalAlignment="Center" IsChecked="False" Background="White" IsEnabled="False">
                        <CheckBox.LayoutTransform>
                            <ScaleTransform ScaleX="2" ScaleY="2" />
                        </CheckBox.LayoutTransform>
                    </CheckBox>
                </Grid>
                <WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="成品交期"></TextBlock>
                        <TextBox Grid.Column="1" KeyUp="txtDAB05_KeyUp" Name="txtDAB05" Width="Auto" Text="{Binding Path=DAB05}" HorizontalAlignment="Stretch"></TextBox>
                        <TextBlock Visibility="Collapsed" Grid.Column="2" Text="回车"  Foreground="Red" ></TextBlock>
                    </Grid >
                    <Grid Visibility="Collapsed"> 
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions> 
                        <TextBlock Grid.Column="2" Text="周期"></TextBlock>
                        <TextBox Grid.Column="3"  Name="txtLDAB05"  Width="Auto" Text="7"></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed">

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="织造交期"></TextBlock>
                        <TextBox Grid.Column="1"  Name="txtDAB55" Text="{Binding Path=DAB55}" Width="Auto" HorizontalAlignment="Stretch"></TextBox>
                        <TextBlock Grid.Column="2" Text="周期"></TextBlock>
                        <TextBox Grid.Column="3" Text="14" Name="txtLDAB55"  Width="Auto" ></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="前织交期"></TextBlock>
                        <TextBox Grid.Column="1"  Name="txtDAB45"  Text="{Binding Path=DAB45}" HorizontalAlignment="Stretch"></TextBox>
                        <TextBlock Grid.Column="2" Text="周期"></TextBlock>
                        <TextBox Grid.Column="3" Text="3" Name="txtLDAB45"  ></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="染色交期"></TextBlock>
                        <TextBox Grid.Column="1"  Name="txtDAB50"  Text="{Binding Path=DAB50}" HorizontalAlignment="Stretch"></TextBox>
                        <TextBlock Grid.Column="2" Text="周期"></TextBlock>
                        <TextBox Grid.Column="3" Text="14" Name="txtLDAB50"  ></TextBox>
                    </Grid>
                </WrapPanel>
           
                <WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="成品"></TextBlock>
                        <TextBox Grid.Column="1" Name="txtFQTYEND" Width="Auto" Text="{Binding Path=FQTYEND}" KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="坯布"></TextBlock>
                        <TextBox Grid.Column="1"   Name="txtRQTYEND" Width="Auto" Text="{Binding Path=RQTYEND}" ></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="浆长"></TextBlock>
                        <TextBox Grid.Column="1"   Name="txtKQTYEND" Width="60" Text="{Binding Path=KQTYEND}" KeyDown="TextBox_KeyDown"></TextBox>
                        <TextBlock Grid.Column="2" Text="整经"></TextBlock>
                        <TextBox Grid.Column="3"   Name="txtWQTYEND"  Text="{Binding Path=KQTYEND}" Width="60" KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="浆伸"></TextBlock>
                        <TextBox Grid.Column="1" Text="0" Name="txtKR01"  Width="30" KeyDown="TextBox_KeyDown"></TextBox>
                        <TextBlock Grid.Column="2" Text="浆损"></TextBlock>
                        <TextBox Grid.Column="3" Text="0" Name="txtKF01"  Width="30" KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="浆缸:"></TextBlock>
                        <TextBox Grid.Column="1" Text="1" Name="txtKJNUM"  Width="30" KeyDown="TextBox_KeyDown"></TextBox>
                        <TextBlock Grid.Column="2" Text="缸损:"></TextBlock>
                        <TextBox Grid.Column="3" Text="0" Name="txtKJWASTGE"  Width="30" KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="30"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="30"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="轴数"></TextBlock>
                        <TextBox Grid.Column="1" Text="0" Name="txtRJNUM" KeyDown="TextBox_KeyDown"></TextBox>
                        <TextBlock Grid.Column="2" Text="轴损"></TextBlock>
                        <TextBox Grid.Column="3" Text="0" Name="txtRJWASTGE" KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid> 
                </WrapPanel> 
                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="坯布"></TextBlock>
                    <TextBox Grid.Column="1"  Name="txtFQTYMAT"  Text="{Binding Path=FQTYMAT}" KeyDown="TextBox_KeyDown"></TextBox>
                </Grid>
                <WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="织缩"></TextBlock>
                        <TextBlock Grid.Column="1" Text="0" Name="txtNRR01" Foreground="Red" FontStyle="Italic"   Height="20" VerticalAlignment="Top" Width="Auto"/>
                        <TextBox Grid.Column="2" Text="0" Name="txtRR01" Width="Auto" Foreground="Red"  KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="整缩"></TextBlock>
                        <TextBlock Grid.Column="1" Text="0" Name="txtNFR01" Foreground="Red" FontStyle="Italic"   Height="20" VerticalAlignment="Top" Width="Auto"/>
                        <TextBox Grid.Column="2"   Text="{Binding FR01}" MinWidth="40"  Width="Auto" Foreground="Red" KeyDown="TextBox_KeyDown"></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="零疵布"></TextBlock>
                        <TextBlock Grid.Column="1" Text="0" Name="txtNFR02" Foreground="Red" FontStyle="Italic"  Height="20" VerticalAlignment="Top" Width="Auto"/>
                        <TextBox Grid.Column="2" Text="0" Name="txtFR02" Width="Auto" Foreground="Red" MinWidth="40"  KeyDown="TextBox_KeyDown" ></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="默认染缩"></TextBlock>
                        <TextBox Grid.Column="1" Text="{Binding GR02}" KeyDown="TextBox_KeyDown" Width="Auto"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="默认常数"></TextBlock>
                        <TextBox Grid.Column="1" Text="{Binding GF02}" MinWidth="30" KeyDown="TextBox_KeyDown"  Width="Auto"></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="染损"></TextBlock>
                        <TextBox Grid.Column="1"  Text="{Binding GR01}"  KeyDown="TextBox_KeyDown" Width="Auto"></TextBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="筘幅"></TextBlock>
                        <TextBlock Grid.Column="1" Text="{Binding NRRWIDTH}" Foreground="Red" MinWidth="30" ></TextBlock>
                        <TextBlock Grid.Column="2" Visibility="Collapsed"  Text="原筘幅"></TextBlock>
                        <TextBlock Grid.Column="3"  Visibility="Collapsed"  Text="{Binding RRWIDTH}"  ></TextBlock>
                        <TextBlock Grid.Column="4" Text="废边" ></TextBlock>
                        <TextBox Grid.Column="5" Width="Auto" Text="{Binding AddWidth}"  KeyDown="TextBox_KeyDown" Margin="0,0,0,0"  MinWidth="20"></TextBox>
                        <TextBlock Grid.Column="6"  Text="实际筘幅"></TextBlock>
                        <TextBlock Grid.Column="7"  Text="{Binding RWGross}" MinWidth="30" Foreground="Red" FontStyle="Italic"   Height="20" VerticalAlignment="Top" Width="Auto"  Margin="0,0,0,0" />
                    </Grid>
                </WrapPanel>
                <WrapPanel>
                    
                
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="整经方式"></TextBlock>
                    <ComboBox Grid.Column="1" Name="cmbWarpType" Width="Auto"  >
                        <ComboBoxItem Content="分条整经"/>
                        <ComboBoxItem Content="单纱上浆"/>
                        <ComboBoxItem Content="分批整经"/>
                        <ComboBoxItem Content="盘头整经"/>
                    </ComboBox>
                </Grid>
                    <WrapPanel>
                        <TextBlock Text="轴染类型"></TextBlock>
                        <ComboBox Grid.Column="1"   Width="80" SelectionChanged="bmtype_SelectionChanged" >
                            <ComboBoxItem Content="大" Tag="D "/>
                            <ComboBoxItem Content="小" Tag="X "/>
                            <ComboBoxItem Content="迷你" Tag="M "/>
                            <ComboBoxItem Content="筒染" Tag="  "/>
                        </ComboBox>
                    </WrapPanel>
                    <WrapPanel>

                        <TextBlock Text="经向脚纱(kg)"></TextBlock>
                        <ComboBox Grid.Column="1" ItemsSource="{Binding Path}"  Width="80" SelectionChanged="coneAddLength_SelectionChanged" >
                            <ComboBoxItem Content="500" Tag="500"/>
                            <ComboBoxItem Content="700" Tag="700"/>
                            <ComboBoxItem Content="1000" Tag="1000"/>
                        </ComboBox>
                    </WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="织机类型"></TextBlock>
                        <ComboBox Grid.Column="1" Name="cmbLoomType" Width="Auto" >
                            <ComboBoxItem Content="剑杆"/>
                            <ComboBoxItem Content="喷气"/>
                        </ComboBox>
                    </Grid>
                </WrapPanel>

            </StackPanel>
            <StackPanel  Grid.Row="1" Grid.Column="1">
                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="40"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=织造计划}}" ></TextBlock>
                    <CheckBox Grid.Column="1" Name="ChkAB55" VerticalAlignment="Center" IsChecked="False" Background="White" IsEnabled="False">
                        <CheckBox.LayoutTransform>
                            <ScaleTransform ScaleX="2" ScaleY="2" />
                        </CheckBox.LayoutTransform>
                    </CheckBox>
                </Grid>

                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=浆纱计划}}" ></TextBlock>
                    <CheckBox Grid.Column="1" Name="ChkAB45" VerticalAlignment="Center" IsChecked="False" Background="White" IsEnabled="False">
                        <CheckBox.LayoutTransform>
                            <ScaleTransform ScaleX="2" ScaleY="2" />
                        </CheckBox.LayoutTransform>
                    </CheckBox>
                </Grid>


                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="经纱重量"></TextBlock>
                    <TextBox Grid.Column="1"   Name="txtKQTYMAT"  Text="{Binding Path=KQTYMAT}" ></TextBox>
                </Grid>
                <Grid Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Text="{Binding Source={Localization:Translate Word=染色计划}}" ></TextBlock>
                    <CheckBox Grid.Column="1" Name="ChkAB50" VerticalAlignment="Center" IsChecked="False" Background="White" IsEnabled="False">
                        <CheckBox.LayoutTransform>
                            <ScaleTransform ScaleX="2" ScaleY="2" />
                        </CheckBox.LayoutTransform>
                    </CheckBox>
                </Grid>
            </StackPanel>  
            <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <DataGrid Grid.Column="0" 
                          AutoGenerateColumns="False" EnableRowVirtualization="True" 
                          HeadersVisibility="Column" 
                          FontSize="12" 
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwBASTGA}}"     
                           Height="Auto" 
                          MinHeight="50"
                          ScrollViewer.HorizontalScrollBarVisibility="Auto"
                          ScrollViewer.VerticalScrollBarVisibility="Auto" 
                          >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=BAGAUFMSL}" Header="轴染" Width="30"  />
                        <DataGridTextColumn Binding="{Binding Path=BAGPOS}" Header="ID" Width="30"   />
                        <DataGridTextColumn Binding="{Binding Path=BAGGART}" Header="纱支" Width="60"  />
                        <DataGridTextColumn Binding="{Binding Path=BAGGFARBE}" Header="色号" Width="60"   />
                        <DataGridTextColumn Binding="{Binding Path=BAGBEM,Converter={StaticResource ResourceKey=gb2312}}" Header="色名" Width="40"  />
                        <DataGridTextColumn Binding="{Binding Path=BAGFDZ}" Header="总头份" Width="40"  />
                        <DataGridTextColumn Binding="{Binding Path=BAGFILLER, Converter={StaticResource ResourceKey=Trim}}" Header="个数" Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=ADDLENGTH}" Header="经向脚纱" Width="30"   />


                    </DataGrid.Columns>
                </DataGrid>
                <DataGrid Grid.Column="1"  
                          AutoGenerateColumns="False" EnableRowVirtualization="True" 
                          HeadersVisibility="Column" 
                          FontSize="12" 
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwWASTGA}}"     
                           Height="Auto" 
                          MinHeight="50"
                          ScrollViewer.HorizontalScrollBarVisibility="Auto"
                          ScrollViewer.VerticalScrollBarVisibility="Auto" 
                          >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=WAGPOS}" Header="ID" Width="Auto" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAGGART}" Header="纱支" Width="Auto" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAGGFARBE}" Header="色号" Width="Auto" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAGBEM,Converter={StaticResource ResourceKey=gb2312}}" Header="色名" Width="Auto" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAGABF}" Header="废边" Width="Auto" MinWidth="30" />
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
       
        </Grid>
    </Grid>
</T:ViewBase>
